import { deleteNode } from '../controller/node'
import { resultWrapper } from '../util/common'
import { interceptor } from './interceptor'

export default app => {
  // 删除节点
  app.post('/node/delete', interceptor({
    isNeedLock: true,
    func: async (req, res) => {
      let {data, message} = await deleteNode(req, res)
      res.send(resultWrapper(data, message))
      return data
    }
  }))
}
